<HTML><HEAD><TITLE>/home/steder/Projects/Tutorials/python/BobChat-v0.3/BobClient.py</TITLE></HEAD>
                  <BODY BGCOLOR=#FFFFFF>
                  <!--header-->
                  <!--script--><PRE><FONT COLOR=#3333CC><B>import</B></FONT> Numeric
A = Numeric.zero( (5,5) )
A[1:3] = 1

<FONT COLOR=#1111CC># B is a 1D version of A</FONT>
B = Numeric.ravel( A )

<FONT COLOR=#1111CC># Ravel is a special case for "unraveling" higher dimensional arrays into 1D arrays.</FONT>
<FONT COLOR=#1111CC># The general function is resize:</FONT>
C = Numeric.resize( A, [5*5] )

<FONT COLOR=#1111CC># D is the shape of A, and is 7 wherever A is (false/zero),</FONT>
<FONT COLOR=#1111CC># and 3 wherever A is (true/non-zero)</FONT>
D = Numeric.where( A, 3, 7 )

<FONT COLOR=#1111CC># Creates a 1D array from 0 to 100 in steps of 1 and creates it all using type 'f'</FONT>
E = Numeric.arrayrange(0,100,1,<FONT COLOR=#115511>'f'</FONT>)

<FONT COLOR=#1111CC># F is E, where all values of E less then 30 have been replaced by 30,</FONT>
<FONT COLOR=#1111CC># everything greater then 60 has been replaced by 60.</FONT>
F = Numeric.clip( E, 30, 60 )
</PRE>
                  <!--footer-->
                  </BODY>
